﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Json;
using System.IO;
using System.Text;

namespace MvcApplication2.Controllers
{
   

    public class HelloController : Controller
    {
        public class GameState
        {
            public List<ChessMan> AllChessMen;
            public string WhoStrokeFirst;
            public string WhoPlayWhite;
            //public GameState();
        }
        //
        // GET: 
        public class ChessMan
        {

            public string Name;
            public int X;
            public int Y;

            //public ChessMan();
        }

        public ActionResult Res(string id)
        {
            string ms = "привет это строка";
            List<ChessMan> df = new List<ChessMan>();
            ChessMan ch1 = new ChessMan();
            ch1.Name = "Tyra";
            ch1.X = 1;
            ch1.Y = 2;
            df.Add(ch1);

            GameState gs = new GameState();
            gs.AllChessMen = df;
            gs.WhoPlayWhite = "gerbert";
            gs.WhoStrokeFirst = "ываываываыв";

            //df.Add("dfgdfg");
            //df.Add("dfg");
            return Json(gs, JsonRequestBehavior.AllowGet); ;

            //return Json(ms,"text/json",Encoding.UTF8, JsonRequestBehavior.AllowGet);
            //return Json(ms, JsonRequestBehavior.AllowGet); ;
        }

    }
}
